package net.miranti.client;

import net.miranti.client.events.FailureEvent;

import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.rpc.AsyncCallback;

public abstract class Callback<T> implements AsyncCallback<T> {
	private final HandlerManager eventBus;

	public Callback(HandlerManager eventBus) {
		this.eventBus = eventBus;
	}

	@Override
	public void onFailure(Throwable caught) {
		eventBus.fireEvent(new FailureEvent(caught));
	}
}
